home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / cisco / account.shar / Makefile < prev    next >
Encoding:
Makefile  |  1992-08-07  |  2.3 KB  |  88 lines

  1. # get cisco IP accounting stuff
  2. # 1.5 90/06/20
  3. #
  4. ###### configuration
  5.  
  6. # directory where the binaries and scripts go
  7. ETCDIR = /usr/local/etc
  8. # file for the raw accounting data
  9. LOGFILE = /usr/spool/log/ipacct
  10. # file for the processed and compressed accounting samples
  11. COMPFILE = /usr/spool/log/ipcomp
  12.  
  13. # command to query ripe database (comment out if you don't have this)
  14. RIPEDBCMD = /usr/local/net
  15.  
  16. # maximum number of values in summaries
  17. NTOP = 30
  18. # cutoff percentage for summaries 
  19. # (lines representing less traffic are suppressed)
  20. CUTPCT = 1
  21.  
  22. # default gateway
  23. SERVER = cwi-gw.cwi.nl
  24.  
  25. # prompts for input during dialogue
  26. # these should really be determined by the program
  27. PROMPT1 = Password:
  28. PROMPT2 = cwi-gw>
  29. PROMPT3 = cwi-gw\#
  30.  
  31. # the passwords 
  32. NORMALPASSWORD = example
  33. ENABLEPASSWORD = example
  34.  
  35. #########################################
  36.  
  37. CFLAGS = -O
  38. TARGETS = getipacct nameipacct ciscotalk
  39.  
  40. all: $(TARGETS)
  41.  
  42. param.sed: Makefile
  43.     echo "s:ETCDIR:$(ETCDIR):g" >param.sed
  44.     echo "s:LOGFILE:$(LOGFILE):g" >>param.sed
  45.     echo "s:COMPFILE:$(COMPFILE):g" >>param.sed
  46.     echo "s:NTOP:$(NTOP):g" >>param.sed
  47.     echo "s:CUTPCT:$(CUTPCT):g" >>param.sed
  48.     echo "s:NORMALPASSWORD:$(NORMALPASSWORD):g" >>param.sed
  49.     echo "s:ENABLEPASSWORD:$(ENABLEPASSWORD):g" >>param.sed
  50.     chmod 600 param.sed
  51.  
  52. ciscotalk.h: Makefile
  53.     echo '#define SERVER "$(SERVER)"' > ciscotalk.h
  54.     echo '#define PROMPT1 "$(PROMPT1)"' >> ciscotalk.h
  55.     echo '#define PROMPT2 "$(PROMPT2)"' >> ciscotalk.h
  56.     echo '#define PROMPT3 "$(PROMPT3)"' >> ciscotalk.h
  57.  
  58. nameipacct.h: Makefile
  59.     echo '#define RIPEDBCMD "$(RIPEDBCMD)"' >> nameipacct.h
  60.  
  61. ciscotalk: ciscotalk.h ciscotalk.c
  62.     $(CC) $(CFLAGS) -o ciscotalk ciscotalk.c
  63.  
  64. nameipacct: nameipacct.h nameipacct.c
  65.     $(CC) $(CFLAGS) -o nameipacct nameipacct.c
  66.  
  67. getipacct: getipacct.sh param.sed
  68.     sed -f param.sed  <getipacct.sh >getipacct
  69.     chmod 700 getipacct
  70.  
  71. install: $(TARGETS)
  72.     cp ciscotalk getipacct nameipacct $(ETCDIR)
  73.     chmod 700 $(ETCDIR)/getipacct
  74.     chmod 770 $(ETCDIR)/ciscotalk
  75.     chmod 770 $(ETCDIR)/nameipacct
  76.     
  77. agg:    $(LOGFILE) agg.awk
  78.     awk -f agg.awk <$(LOGFILE) | sort -rn +3 >agg
  79. clean: 
  80.     rm -f $(TARGETS) *.o ,* core tmp* param.sed ciscotalk.h nameipacct.h
  81.  
  82. distrib: 
  83.     mv Makefile Makefile.bak
  84.     sed -f distrib.sed <Makefile.bak >Makefile
  85.     packmail -odistrib -t'ipacct stuff' `cat DISTRIB`
  86.     rm -f Makefile
  87.     mv Makefile.bak Makefile
  88.